//package com.eastfair.point.service.impl;
//
//import com.alibaba.fastjson.JSON;
//import com.alibaba.fastjson.JSONObject;
//import com.eastfair.cache.repository.CachePlusOps;
//import com.eastfair.core.context.ContextUtil;
//import com.eastfair.core.point.BusinBasePoint;
//import com.eastfair.mq.model.MySimpleMessage;
//import com.eastfair.mq.service.AbstractPointService;
//import com.eastfair.mq.service.BusinessPointService;
//import com.eastfair.mq.service.TransactionPointService;
//import com.eastfair.point.PointKeyDefinition;
//import com.eastfair.point.point.CardTransaction;
//import com.eastfair.point.point.OrderTransaction;
//import com.eastfair.point.point.StoreTransaction;
//import com.eastfair.point.service.CardService;
//import com.eastfair.point.service.OrderService;
//import com.eastfair.point.service.StoreService;
//import com.eastfair.transaction.util.TransactionUtil;
//import io.lettuce.core.ScoredValue;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.BeanUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//
//import java.util.HashMap;
//import java.util.Map;
//
//
///**
// * <p>
// * 单业务处理事件
// * </p>
// *
// * @author ligang
// * @date 2021-08-10
// */
//@Slf4j
//@Service
//public class TransactionPointServiceImpl extends AbstractPointService implements TransactionPointService {
//    @Autowired
//    OrderService orderService;
//    @Autowired
//    StoreService storeService;
//    @Autowired
//    CardService cardService;
//
//    @Autowired
//    TransactionUtil transactionUtil;
//
//    @Override
//    public void executeBusin(MySimpleMessage mySimpleMessage) {
//        String tag = transactionUtil.queryTag(mySimpleMessage);
//        HashMap<String,Object> problems = (HashMap<String, Object>) mySimpleMessage.getPayload();
//        JSONObject entityJsonObject = new JSONObject();
//        entityJsonObject.putAll(problems);
//        if (PointKeyDefinition.TRANSACTION_ORDER.equals(tag)) {
////            OrderTransaction orderTransaction = JSONObject.parseObject(mySimpleMessage.getPayload().toString(), OrderTransaction.class);
////            orderService.executeBusinOfReceiveMsg(orderTransaction);
//        } else if (PointKeyDefinition.TRANSACTION_STORE.equals(tag)) {
//            OrderTransaction orderTransaction = JSONObject.parseObject(entityJsonObject.toString(), OrderTransaction.class);
//            //组装 仓库实体
//            StoreTransaction storeTransaction = new StoreTransaction();
//            BeanUtils.copyProperties(orderTransaction, storeTransaction);
//            storeService.executeBusinOfReceiveMsg(storeTransaction);
//        } else if (PointKeyDefinition.TRANSACTION_SCORE.equals(tag)) {
//            StoreTransaction storeTransaction = JSONObject.parseObject(entityJsonObject.toString(), StoreTransaction.class);
//            //组装 积分实体
//            CardTransaction cardTransaction = new CardTransaction();
//            BeanUtils.copyProperties(storeTransaction, cardTransaction);
//            cardService.executeBusinOfReceiveMsg(cardTransaction);
//        }
//    }
//}
